package cn.stylefeng.guns.config;

import feign.RequestInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClientProperties;
import org.springframework.context.annotation.Bean;

@Slf4j
public class FeignConfig extends FeignClientProperties.FeignClientConfiguration {
    @Bean
    public RequestInterceptor requestInterceptor() {
        return requestTemplate -> {
            log.info("feign search url: {} ,params: {}", requestTemplate.request().url(), requestTemplate.requestBody().asString());
        };
    }
}
